package Template;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

/**
 * 归并排序
 */
public class mergeSort {
    public static void main(String[] args) throws IOException {
        BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
        int N = Integer.parseInt(bf.readLine());
        int[] arr = new int[N];
        String[] s = bf.readLine().split(" ");
        for (int i = 0; i < N; i++) {
            arr[i] = Integer.parseInt(s[i]);
        }
        mergeSort(arr, 0, N - 1);
        for (int i = 0; i < N; i++) {
            System.out.print(arr[i] + " ");
        }
        bf.close();
    }


    private static int[] mergeSort(int[] arr, int left, int right) {
        if (left >= right) {
            return arr;
        }
        int mid = left + right >> 1;
        arr = mergeSort(arr, left, mid);
        arr = mergeSort(arr, mid + 1, right);

        int l = left;
        int r = mid + 1;
        int[] temp = new int[right - left + 1];
        int k = 0;
        while (l <= mid && r <= right) {
            if (arr[l] < arr[r]) {
                temp[k++] = arr[l++];
            } else {
                temp[k++] = arr[r++];
            }
        }

        while (l <= mid) {
            temp[k++] = arr[l++];
        }
        while (r <= right) {
            temp[k++] = arr[r++];
        }

        for (int i = left, j = 0; i <= right; i++, j++) {
            arr[i] = temp[j];
        }
        return arr;
    }
}
